﻿
namespace LDM.Framework;

/// <summary>
/// Jwt验证参数设置
/// </summary>
public class JwtParametersOptions
{
    /// <summary>
    /// 签发方密钥
    /// </summary>
    public string IssuerSigningKey { get; set; }

    /// <summary>
    /// 是否验证签发方密钥
    /// </summary>
    public bool ValidateIssuerSigningKey { get; set; }

    /// <summary>
    /// 签发方
    /// </summary>
    public string ValidIssuer { get; set; }

    /// <summary>
    /// 是否验证签发方
    /// </summary>
    public bool ValidateIssuer { get; set; }

    /// <summary>
    /// 签收方
    /// </summary>
    public string ValidAudience { get; set; }

    /// <summary>
    /// 是否验证签收方
    /// </summary>
    public bool ValidateAudience { get; set; }

    /// <summary>
    /// 是否验证Token有效期，使用当前时间与Token的Claims中的NotBefore和Expires对比
    /// </summary>
    public bool ValidateLifetime { get; set; }

    /// <summary>
    /// 允许的服务器时间偏移量
    /// </summary>
    public long ClockSkew { get; set; }

    /// <summary>
    /// 过期时间（分钟）
    /// </summary>
    public long ExpiredTime { get; set; }

    /// <summary>
    /// 是否启用刷新Token
    /// </summary>
    public bool EnableRefreshToken { get; set; }

    /// <summary>
    /// 刷新Token过期时间（分钟）
    /// </summary>
    public long RefreshTokenExpiredTime { get; set; }

    /// <summary>
    /// 加密算法
    /// </summary>
    public string Algorithm { get; set; }

}